#include<stdbool.h>
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<stdbool.h>
#include<time.h>

typedef struct SnackNode
{
	int x;
	int y;
	struct SnackNode* next;
}snacknode;

enum Direction
{
	up = 1,
	down,
	left,
	right,
};

enum Snackstatus
{
	exsit = 1,
	killedbywall,
	selfkilled,
};

enum speedstate
{
	fast = 100,
	normal = 300,
	slow = 500,
};

struct parameter
{
	snacknode* snackhead;
	enum speedstate speed;
	enum Direction direction;
	enum Snackstaus snackstaus;
	snacknode* foodpointer;
	int goal;
};

struct parameter* parainit(snacknode*);
void printmap();
void printnote();
void SetPos(short x, short y);
snacknode* prepare();
void snackinit(snacknode**);
void printsnack(snacknode*);
snacknode* creatfood(snacknode*);
void game( struct parameter*);
void move(struct parameter*);
void checkeat(struct parameter*);
void checkexsit(struct parameter* para);
void end(struct parameter**);